using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace BlogKickStart.Models.Mapping
{
    public class StyleMap : EntityTypeConfiguration<Style>
    {
        public StyleMap()
        {
            // Primary Key
            this.HasKey(t => t.StyleID);

            // Properties
            this.Property(t => t.StyleNM)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("Styles");
            this.Property(t => t.StyleID).HasColumnName("StyleID");
            this.Property(t => t.StyleNM).HasColumnName("StyleNM");
        }
    }
}
